import torch

# ==== 定义 Brightness 噪声类 ====
class BrightnessNoise(torch.nn.Module):
    """Poisson 噪声 (依赖像素强度)"""
    def __init__(self, scale=0.2):
        super().__init__()
        self.scale = scale

    def forward(self, x):
        """
        应用 S2 = S1 + Δ 的亮度调整
        image_tensor: 形状为 [C, H, W]，值范围 [0, 1]
        delta: 亮度偏移量 (-1 到 1 之间)
        """
        return x + self.scale